﻿using System.Collections.Generic;

namespace DMS.BEs
{
	public class Album : Persistent
	{
		private readonly IList<Track> tracks;

		public Album()
		{
			tracks = new List<Track>();
		}

		public virtual Artist Artist { get; set; }
		public virtual string Title { get; set; }

		public virtual ICollection<Track> Tracks
		{
			get { return tracks; }
		}

		public virtual void AddTrack(Track track)
		{
			track.Album = this;
			tracks.Add(track);
		}

		public virtual Track GetTrack(int index)
		{
			return tracks[index];
		}
	}
}